program Rectangle;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  Rect=class
    a, b, s: integer;
    procedure square; virtual;
    procedure update;
  end;
{ Rectangle }

  SmartRect=class (Rect)
    f: integer;
    procedure set1(newa, newb: integer);
    procedure square; override;
  end;
procedure Rect.square;
begin
  writeln(s);
end;

procedure Rect.update;
begin
  s:=a*b;
end;

var
  t:Rect;
  s:Smartrect;
  newa, newb: integer;
{ SmartRect }

procedure SmartRect.set1(newa, newb: integer);
begin
  s:=newa*newb;
  f:=1;
end;

procedure SmartRect.square;
begin
  if (f<>1) then
    writeln('You forgot set1');
  writeln(s);
end;

begin
  t:=rect.create;
  s:=smartrect.create;
  t.a:=3;
  t.b:=5;
  t.update;
  t.square;
  s.square;
  s.set1(6, 4);
  s.square;
  readln;
end.
 